1. [iPad] get width during init stage

window.innerWidth can be used to get the width of device, but get wrong number (980 px, should be 768px) on iPad during “DOMContentLoaded” stage. Once everything’s loaded, problem’s gone.

only happens when redirected from other links, simply refresh won’t cause the issue

instead, use screen.width solves problem.

environment: iPad, iOS 9.0.1, Safari